package com.itqf.edu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.itqf.edu.mapper.CourseMapper;
import com.itqf.edu.pojo.Course;
import com.itqf.edu.service.CourseService;
import com.itqf.edu.vo.R;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * projectName: edu
 *
 * @author: 宋亚楠
 * time: 2021/9/28 21:33
 * description:
 */
@Service
@MapperScan("com.itqf.edu.mapper")
public class CourseServiceImpl implements CourseService {

    @Autowired
    private CourseMapper courseMapper;

    /**
     * 展示
     * @return
     */
    @Override
    public R list() {

        QueryWrapper<Course> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("cdeletede", 0);

        List<Course> courses = courseMapper.selectList(queryWrapper);


        return R.OK("查询成功", courses);
    }
}
